import java.util.Arrays;

/**
 * Created with Intellij JDEA
 * Description:
 * User:
 * Date:2022-04-11
 * Time:12:16
 */
public class 统计各位数字都不同的数字个数 {
    public int countNumbersWithUniqueDigits(int n) {
        if (n == 0) {
            return 1;
        }
        if (n == 1) {
            return 10;
        }
        int cur = 9;
        int ret = 10;
        for (int i = 0;i < n-1;i++) {
            cur *= 9-i;
            ret += cur;
        }
        return ret;
    }
}
